<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    <cpn1></cpn1>
    <cpn2></cpn2>
</div>
<script src="../../js/vue.js"></script>
<script>
    //1.注册全局组件
    Vue.component("cpn1", {
        template: `
           <div>这是一个组件</div>
            `
    })
    //2.注册局部组件
    new Vue({
        el: "#app",
        data: {
            message: "你好，世界",
        },
        components: {
            cpn2: {
                template: `
            <div>
               <div>这是一个局部组件语法糖</div>
            </div>
            `
            }
        }
    })
</script>
</body>
</html>